﻿using System;
using System.Collections.Generic;
using System.Text;
using ShootSearch.Core;
using ShootSearch.Util;
using System.Data.SqlClient;
using ShootSearch.Core.ObjectItems;

namespace ShootSearch.Indexers
{
    public class DBIndexerConfig:SpiderManConfig, ICloneable
    {
        public AssemblyConfig Connection { get; set; }
        public string ConnectionString { get; set; }
        public string Table { get; set; }
        public string TableCreation { get; set; }
        public string TableCheck { get; set; }
        public AssemblyWithConfig ObjectParser { get; set; }

        public DBIndexerConfig()
        {
            Connection = new AssemblyConfig(typeof(SqlConnection));
            ObjectParser = new AssemblyWithConfig(new ObjectParser());
           
        }

        #region ICloneable Members

        public object Clone()
        {
            DBIndexerConfig config = new DBIndexerConfig();
            config.Connection = this.Connection;
            config.ConnectionString = this.ConnectionString;
            config.Table = this.Table;
            config.TableCreation = this.TableCreation;
            config.TableCheck = this.TableCheck;
            config.ObjectParser = this.ObjectParser;
            return config;
        }

        #endregion
    }
}
